//-----------------------------------------------------------------------
// <copyright file="ExceptionContext.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics
{
    using System;
    using System.Threading;
    using System.Reflection;
    using System.Diagnostics;

    using System.Security.Principal;

    /// <summary>
    /// Provides additional contextual information to be published along with the associated <see cref="T:System.Exception"/> instance.
    /// </summary>
    public sealed class ExceptionContext : ContextBase
    {
        #region public ExceptionContext(Exception ex, IIdentity identity, Assembly assembly, Process process, Thread thread, AppDomain appDomain)

        /// <summary>
        /// Initializes a new instance of the <see cref="T:ExceptionContext"/> class.
        /// </summary>
        /// <param name="ex">The <see cref="T:System.Exception"/> instance to be published.</param>
        /// <param name="identity">The <see cref="T:System.Security.Principal.IIdentity"/> of the <see cref="T:System.Security.Principal.IPrincipal"/> under which the code that threw the exception was executing.</param>
        /// <param name="assembly">The <see cref="T:System.Reflection.Assembly"/> within which the exception was thrown.</param>
        /// <param name="process">The <see cref="T:System.Diagnostics.Process"/> within which the exception was thrown.</param>
        /// <param name="thread">The <see cref="T:System.Threading.Thread"/> within which the exception was thrown.</param>
        /// <param name="appDomain">The <see cref="T:System.AppDomain"/> within which the exception was thrown.</param>
        public ExceptionContext(Exception ex, IIdentity identity, Assembly assembly, Process process, Thread thread, AppDomain appDomain) : base(assembly, appDomain, thread, process, identity)
        {
            this.Exception = ex;
        }

        #endregion

        #region public Exception Exception

        /// <summary>
        /// Gets the <see cref="T:System.Exception"/> instance to be published.
        /// </summary>
        /// <value>The <see cref="T:System.Exception"/> instance to be published.</value>
        public Exception Exception
        {
            get;
            private set;
        }

        #endregion
    }
}
